<%@page import="org.apache.commons.lang3.StringEscapeUtils"%>
<%@page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String defUsername = com.zq.it.cms.common.Constants.DEF_USERNAME;
    String defPassword = com.zq.it.cms.common.Constants.DEF_PASSWORD;
    String username = (String) request.getAttribute("username");
    username = StringEscapeUtils.escapeHtml4(username);
    if (username != null) {
        defUsername = username;
    }
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="robots" content="none" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title><jsp:include page="/WEB-INF/views/title.jsp" /></title>
	<link rel="stylesheet" href="${ctx}/static/admin/css/login.css">
	<script type="text/javascript" src="${ctx}/static/admin/js/jquery.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/admin/js/jquery.SuperSlide.js"></script>
	<script type="text/javascript" src="${ctx}/static/admin/js/Validform_v5.3.2_min.js"></script>
	<script type="text/javascript" src="${ctx}/static/admin/js/Particleground.js"></script>
	<script type="text/javascript">
		if (top != this) {
        	top.location = this.location;
    	}
		$(function() {
			$(".i-text").focus(function() {
				$(this).addClass("h-light");
			});
			$(".i-text").focusout(function() {
				$(this).removeClass("h-light");
			});
			$("#username").focus(function() {
				var username = $(this).val();
				if (username == "输入账号") {
					$(this).val("");
				}
			});
			$("#username").focusout(function() {
				var username = $(this).val();
				if (username == "") {
					$(this).val("输入账号");
				}
			});
			$("#password").focus(function() {
				var username = $(this).val();
				if (username == "输入密码") {
					$(this).val("");
				}
			});
			$("#yzm").focus(function() {
				var username = $(this).val();
				if (username == "输入验证码") {
					$(this).val("");
				}
			});
			$("#yzm").focusout(function() {
				var username = $(this).val();
				if (username == "") {
					$(this).val("输入验证码");
				}
			});
			$(".registerform").Validform({
				tiptype : function(msg, o, cssctl) {
					var objtip = $(".error-box");
					cssctl(objtip, o.type);
					objtip.text(msg);
				},
				ajaxPost : false
			});
			$("#particleground").particleground({
			    dotColor: "#0000FF",
			    lineColor: "#00FF00",
			    directionX: "center",
			    directionY: "center"
			});
		});
	</script>
</head>
<body>
	<div id="particleground" style="position: absolute;left:0;top:0;width: 100%;height: 100%;z-index: 2;"></div>
	<div class="header">
		<h1 class="headerLogo">
			<a title="后台管理系统" href="#">
				<img alt="logo" src="${ctx}/static/admin/images/logo.gif">
			</a>
		</h1>
		<div class="headerNav">
			<a href="#">企业官网</a>
			<a href="#">关于我们</a>
			<a href="#">开发团队</a>
			<a href="#">意见反馈</a>
			<a href="#">帮助</a>
		</div>
	</div>
	<div class="banner">
		<div class="login-aside" style="height: auto;">
			<div id="o-box-up" style="height: 100%;"></div>
			<div id="o-box-down" style="table-layout:fixed;height: auto;position: relative;">
				<c:if test="${!empty shiroLoginFailure}">
					<div style="color: #f7ccc8;font-size: 12px;margin-bottom: 10px;">
	                <c:choose>
	                    <c:when test="${shiroLoginFailure=='org.apache.shiro.authc.IncorrectCredentialsException'}">
	                        	密码错误
	                    </c:when>
	                    <c:when test="${shiroLoginFailure=='org.apache.shiro.authc.UnknownAccountException'}">
	                        	用户不存在
	                    </c:when>
	                    <c:when test="${shiroLoginFailure=='org.apache.shiro.authc.UnknownAccountException'}">
	                        	用户不存在
	                    </c:when>
	                    <c:when test="${shiroLoginFailure=='org.apache.shiro.authc.LockedAccountException'}">
	                        	用户被锁定
	                    </c:when>
	                    <c:when test="${shiroLoginFailure=='com.zq.it.cms.common.security.UnactivatedAccountException'}">
	                        	用户未激活
	                    </c:when>
	                    <c:otherwise>
	                        <s:message code='usernameOrPasswordError'/>
	                    </c:otherwise>
	                </c:choose>
	                </div>
	            </c:if>
				<div class="error-box"></div>
				<form class="registerform" action="login.do" method="post">
					<div class="fm-item">
						<label for="logonId" class="form-label">CMS系统登陆：</label>
						<input type="text" value="<%=defUsername %>" name="username" maxlength="100" id="username" class="i-text" datatype="s4-18" errormsg="用户名至少4个字符,最多18个字符！"/>
						<div class="ui-form-explain"></div>
					</div>
					<div class="fm-item">
						<label for="logonId" class="form-label">登陆密码：</label>
						<input type="password" value="<%=defPassword %>" name="password" maxlength="100" id="password" class="i-text" datatype="*0-16" nullmsg="请输入密码！" errormsg="密码范围在0~16位之间！"/>
						<div class="ui-form-explain"></div>
					</div>
					<div class="fm-item pos-r">
						<label for="logonId" class="form-label">验证码</label>
						<input type="text" value="1243" maxlength="4" id="yzm" class="i-text yzm" datatype="s4-4" nullmsg="请输入验证码！" errormsg="请输入4位验证码！"/>
						<div class="ui-form-explain">
							<img src="${ctx}/static/admin/images/yzm.jpg" class="yzm-img" />
						</div>
					</div>
					<div class="fm-item">
						<label for="logonId" class="form-label"></label>
						<input type="submit" value="" tabindex="4" id="send-btn" class="btn-login" />
						<div class="ui-form-explain"></div>
					</div>
				</form>
			</div>
		</div>
		<div class="bd">
			<ul>
				<li style="background:url(${ctx}/static/admin/images/theme-pic1.jpg) #CCE1F3 center 0 no-repeat;">
				</li>
				<li style="background:url(${ctx}/static/admin/images/theme-pic2.jpg) #BCE0FF center 0 no-repeat;">
				</li>
			</ul>
		</div>
		<div class="hd">
			<ul></ul>
		</div>
	</div>
	<script type="text/javascript">
		jQuery(".banner").slide({
			titCell : ".hd ul",
			mainCell : ".bd ul",
			effect : "fold",
			autoPlay : true,
			autoPage : true,
			trigger : "click"
		});
	</script>
	<div class="banner-shadow"></div>
	<div class="footer">
		<p>
			Powered by XXXX &copy; 2014-2018 XXXX All Rights Reserved
		</p>
		<p>&nbsp;</p>
		<p>
			XXXX科技有限公司 版权所有 渝ICP备XXXXX号
		</p>
	</div>
</body>
</html>
